﻿using Domain.ValueObjects;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

namespace Infrastructure.Data.ValueConverter
{
    /// <summary>
    /// 用户昵称转换
    /// </summary>
    internal class NickNameToStringConverter : ValueConverter<NickName, string>
    {
        public NickNameToStringConverter()
            : base(
                v => v.Value,
                v => NickName.Create(v)
            )
        { }
    }
}
